package com.dc.project.entity.bo;

import com.dc.project.entity.po.TemplateDetailAttachmentField;
import com.own.component.common.base.entity.BaseBo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TemplateDetailAttachmentFieldBo
 *
 * @author chenxueli
 * @date 2025-03-19 13:23:08
 */
@Schema(title = "模板详情附件字段" + ConstantBeanSuffix.BO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TemplateDetailAttachmentFieldBo extends BaseBo<TemplateDetailAttachmentField> implements Serializable {

    /**
     * 模板详情附件id
     */
    private Long detailAttachmentId;

    /**
     * 上级字段id
     */
    private Long parentId;

    /**
     * 字段名称
     */
    private String name;

    /**
     * 字段描述
     */
    private String description;

    /**
     * 默认值
     */
    private String defaultValue;

    /**
     * 字段类型 1=文本 2=整数 3=小数 4=数字 5=表格-行循环 6=表格-列循环 7=列表 8=图片 9=区块对
     */
    private Integer type;

    /**
     * 转持久化对象
     *
     * @param entity 原持久化对象
     * @return 持久化对象
     */
    @Override
    public TemplateDetailAttachmentField toPo(TemplateDetailAttachmentField entity) {
        if (entity == null) {
            entity = new TemplateDetailAttachmentField();
        }
        entity.setFkDetailAttachmentId(this.detailAttachmentId);
        entity.setFkParentId(this.parentId);
        entity.setName(this.name);
        entity.setDescription(this.description);
        entity.setDefaultValue(this.defaultValue);
        entity.setType(this.type);
        return super.toPo(entity);
    }

}

